package fr.nts.framework.front.test.form;

import fr.nts.framework.front.form.AbstractForm;
import fr.nts.framework.front.form.FieldType;
import fr.nts.framework.front.form.annotation.Form;
import fr.nts.framework.front.form.annotation.FormField;
import fr.nts.framework.front.form.annotation.FormListOfValues;
import fr.nts.framework.front.form.validation.annotation.NumberConstraint;
import fr.nts.framework.front.form.validation.annotation.StringConstraint;

@Form(name = "testForm")
public class ATestForm extends AbstractForm{

	private static final long serialVersionUID = 1L;
	
	@FormField(size = 30)
	@StringConstraint(minSize = 2, maxSize = 4, notNull = true)
	private String name;

	@FormField(size = 30, mandatory = true)
	@NumberConstraint(min = 4, max = 110, notNull = true)
	private String age;
	
	@FormListOfValues(fixedValues = {"choix1", "choix2"})
	@FormField(type = FieldType.LIST_OF_CHECKBOX)
	private String[] choice;
	
	private String firstname;
	
	
	// GETTER / SETTER
	public String getName(){
		return name;
	}

	public void setName(String name){
		this.name = name;
	}

	public String getFirstname(){
		return firstname;
	}

	public void setFirstname(String firstname){
		this.firstname = firstname;
	}

	public String getAge(){
		return age;
	}

	public void setAge(String age){
		this.age = age;
	}

	public String[] getChoice(){
		return choice;
	}

	public void setChoice(String[] choice){
		this.choice = choice;
	}
}